FROM jenkins/jenkins:lts-jdk11
# if we want to install via apt
USER root
WORKDIR /root/
RUN echo "deb https://mirrors.aliyun.com/debian/ bullseye main non-free contrib \
          deb-src https://mirrors.aliyun.com/debian/ bullseye main non-free contrib \
          deb https://mirrors.aliyun.com/debian-security/ bullseye-security main \
          deb-src https://mirrors.aliyun.com/debian-security/ bullseye-security main \
          deb https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib \
          deb-src https://mirrors.aliyun.com/debian/ bullseye-updates main non-free contrib \
          deb https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib \
          deb-src https://mirrors.aliyun.com/debian/ bullseye-backports main non-free contrib " > /etc/apt/sources.list
RUN apt update
RUN apt install -y gcc golang wget git
# drop back to the regular jenkins user - good practice
USER jenkins

☁  ~  docker run -d --name jenkins -p 8085:8080 -v /data/jenkins_home:/var/jenkins_home jenkins/jenkins:lts

☁  ~  docker run -d --name jenkins -p 8085:8080 -v /data/jenkins_home:/var/jenkins_home jenkins/jenkins:lts
